home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows4 / pcproj.zip / PROJAPP.ACT < prev    next >
Text File  |  1989-12-30  |  3KB  |  94 lines

  1. /*  ProjApp.act  --based on the skeleton file UserApp.act.
  2.  
  3.     This file is used during the seal off process to define
  4.     methods specific to the project application.
  5. */
  6.  
  7.  
  8. /* Define the application class */
  9. inherit(Object, #ProjApp, #(pw), nil, nil)!!
  10.  
  11. /* Define an init method for ProjApp.  This is executed when the
  12.    application starts up, and must create the windows and objects
  13.    necessary for the application.
  14. */!!
  15.  
  16. now(ProjApp)!!
  17.  
  18. /* Start the application and display the About box.
  19.    If a command line has been specified, then the first word is the
  20.    image file and the second is the data file.  If a command line
  21.    is specified, load the data file using the appropriate extension. */
  22. Def init(self , cmdLine | dlg, fName)
  23. {       initSystem(self);
  24.         register(ProjWindow);
  25.         register(GanttWindow);
  26.         pw := new(ProjWindow, nil, nil, loadString(PW_APPNAME), nil);
  27.         show(pw, CmdShow);
  28.         pw.isMain := true;
  29.  
  30.         if cmdLine
  31.           fName := words(cmdLine)[1];
  32.           if size(fName) > 1
  33.              fileOpen(pw, fName + "." + loadString(PW_EXTENSION));
  34.           endif;
  35.         endif;
  36.  
  37.         dlg := new(Dialog);
  38.         runModal(dlg, ABOUT_BOX, pw);
  39.         /* move the cursor to the top in case there's no mouse */
  40.         setCursorPos(pw, point(pw.boxHSpace, pw.boxHeight));
  41. }!!
  42.  
  43. /* Check if it's ok to close the window. */
  44. Def shouldClose(self)
  45. {
  46.   ^shouldClose(pw);
  47. }!!
  48.  
  49. /* The installation method for the application.
  50.    This removes the compiler and miscelaneous junk and then
  51.    takes a snapshot.
  52.  
  53.  Note: This method must be invoked via abort(installProj));
  54.        or abort(Object.methods[#installProj]);
  55. */
  56. now(Object)!!
  57.  
  58. Def installProj(self)
  59. {       setName(VImage, "Project.ima");
  60.         removeCompiler();
  61.         removeJunk();           /* unused methods */
  62.         TheApp := new(ProjApp);
  63.         printLine("sealing off...");
  64.         cleanup();
  65.         create(VImage);
  66.         snap(VImage, 62, 25);   /* Static and Dynamic memory */
  67.                                 /* adjust later with MemChg.EXE */
  68.         close(VImage);
  69.         exit();
  70. }!!
  71.  
  72. /* Remove unused methods during seal off. */
  73. Def removeJunk(self)
  74. {
  75.   removeGlobal(#OrderedDictionary);
  76.   removeGlobal(#TextCollection);
  77.   printLine("removing...");
  78.   removeMethods(Number, #(cos sqrt tan sin exp log arcCos arcSin degToRad
  79.         radToDeg));
  80.   removeMethods(Int, #(random));
  81.   removeMethods(Rect, #(inflate offset intersect union));
  82.   removeMethods(Object, #(removeCompiler));
  83.   removeMethods(Network, #(show));
  84.   removeMethods(Node, #(show));
  85.   removeMethods(Date, #(asLongString asVeryLongString asDayString
  86.         diff inc dec next previous dayOfWeek));
  87.   removeMethods(DateClass, #(current));
  88.  
  89.   /* automatically generated by space optimize utility */
  90.   removeJunk1();
  91.   removeJunk2();
  92.   removeMethods(Object, #(removeJunk1 removeJunk2));
  93. }!!
  94.